package com.inossem.warehousemanage_tv.utils;

import android.content.Context;
import android.util.TypedValue;

/**
 * 屏幕适配工具类
 *
 * @author 詹建宇
 * @time on 2018/3/12 14:44
 * @email jianyu.zhan@inossem.com
 */
public class DensityHelper {

    /**
     * 转换dp为px
     *
     * @param context context
     * @param value   需要转换的dp值
     * @return px
     */
    public static int dp2px(Context context, float value) {
        float scale = context.getResources().getDisplayMetrics().density;
        return (int) (value * scale + 0.5f);
    }


}
